package auth

import (
	"github.com/kataras/iris/v12"
	"iris-demo/core"
)

func SetAuthRouters(router *iris.Application, urlPrefix string) {
	c := AuthController{}
	authRouters := router.Party(urlPrefix)
	{
		authRouters.Post("/login", c.Login)
		authRouters.Post("/register", c.Register)
		authRouters.Patch("/change_password/{id:uint}", c.ChangePassword)
	}
}

func SetUserRouters(router *iris.Application, urlPrefix string) {
	c := UserController{}
	userRouters := router.Party(urlPrefix, core.JWT.Serve)
	{
		userRouters.Get("/users", c.List)
	}
}
